<template>
<div>


  <el-table
    :data="tableData"
    :header-row-style="{ background: '#3B4C7F', color: '#303133' }"
    :row-style="{ background: '#909399', color: '#303133' }"
    style="width: 95%; margin: 10px"
    height="105"
  >
    <el-table-column fixed prop="date" label="日期" width="100">
    </el-table-column>
    <el-table-column prop="title" label="标题" width="240"> </el-table-column>
    <el-table-column width="80">
      <template slot="header" slot-scope="scope">
        <el-button
          type="info"
          icon="el-icon-more"
          circle
          size="mini"
          @click="drawer = true"
        ></el-button>
        <!-- <el-button type="primary" size="mini" style="padding-right: 10px" type="info" icon="el-icon-more"></el-button> -->
      </template>
      <template slot-scope="scope">
        <a
          @click="handleEdit(scope.$index, scope.row)"
          href="javascript:void()"
          style="text-decoration: none; color: #f56c6c"
          >查看</a
        >
        <!-- <el-button size="mini" @click="handleEdit(scope.$index, scope.row)"
        style="background-color: red;"
          >查看</el-button
        > -->
      </template>
    </el-table-column>

    <!-- <el-table-column
      prop="city"
      label="市区"
      width="120">
    </el-table-column>
    <el-table-column
      prop="address"
      label="地址"
      width="300">
    </el-table-column>
    <el-table-column
      prop="zip"
      label="邮编"
      width="120">
    </el-table-column> -->
    
  </el-table>
  <el-drawer
      title="最新新闻"
      :visible.sync="drawer"
      :direction="direction"
      
    >
      <iframe 
        src="https://voice.baidu.com/act/newpneumonia/newpneumonia/?from=osari_aladin_banner#tab1" 
        frameborder="0"
        width="100%"
        height="100%"></iframe>
    </el-drawer>
</div>
</template>

<script>
import request from "../utils/request";
export default {
  data() {
    return {
      drawer: false,
      direction: "rtl",
      tableData: [],
    };
  },
  methods: {
    handleEdit(index, row) {
      window.open(this.tableData[index].text)
    },
    handleClose(done) {
      this.$confirm("确认关闭？")
        .then((_) => {
          done();
        })
        .catch((_) => {});
    },
  },
  mounted() {
    request.get('/cov/article').then(res => {
      this.tableData = res;
    })
  },
};
</script>
<style>
</style>